;v1.7a VERY minor tweaks to Gisbert's latest significant rewrite! (24 Oct 89) ; (mainly because I'm still figuring out some of the logic!) ; That's one tricky file name parser! ; - Removed old version numbers (earlier than v1.7) ; - Seems to work, so deleting the big chunks of commented-out code. ; - Why do you put variable names in brackets, Gisbert? ; I do that ONLY when I'm using that variable (a word) as a ; pointer .. that way it jumps out at me. ; Compiler's don't seem to mind! ; - Re-tabified (again .. sigh .. doesn't TASM have an ASCII 9 tab? ; ; Ain't this international joint hackery fun? ; Toad Hall ;v1.7 Another round from Bonn (20 Oct 89): ; - fixed a bug in ZIP file name parsing: wouldn't accept a parent ; dir in path ('..\blah'), nor dirs including .TYPEs (WHO uses those??) ; - leave .TYP of zip file alone if specified on command line; why force ; it to ZIP?? (Assuming the user knows what she does.) ; - David's complaint about missing file name expansion routines pitied ; me; so here's neat parsing, and the way DOS always should have worked: ; 'a*d' will match 'ad' and 'abd' and 'abcd' but not 'a' or 'ab'...; ; 'a?d' will match 'abd' but not 'ad'. Side effect: 'foo*' will ; match 'foo' and 'foo.bar' - period is just an ordinary char. ; This applies to ZIP members only, not to ZIP file names! (Could ; be done easily, though. Too lazy for now. See comments in Find_ZIP.) ; Thanks to Gunter Rademacher for a fine algorithm. ;v1.6b Back at Toad Hall ... (28 Sep 89) ; - Removed old commented-out code (via v1.5, v1.6, v1.6a changes). ; - NICE ideas in v1.6a .. attaboy, Gisbert! ; - No significant changes .. just cleaned up, making a "formal" ; release from Toad Hall. ; - Suppose we oughtta put in yet ANOTHER cmdline switch (-c or ; something) for those who actually wanna pipe names (paths'n'all) ; to StdOut. (The -c means omit ZIP comments.) ;v1.6a GWS (yeah, hacking away in West Germany's capital village) strikes again ; - Cleaning up verbose display: ; Some columns were one off. Also, change name alignment slightly. ; - Added /m ('monosyllabic') command line switch: ; This will show full names, paths'n'all, as stored in the Zip, ; one per line, and nothing else. May be nice for piping into ; other programmes. - Beware of the header lines, though. ;v1.6 - v1.4a Changes: ; Gisbert Selke (all the way from Germany, I think) tweaked the earlier ; v1.4 (see v1.4a comments). ; I kept his changes (that I hadn't already added in v1.5 myself), ; incorporating them into the v1.5 code. (Of course, just HAD to tweak ; his changes as well!) ; - Member filenames: ; Still considering shifting filenames to the right hand side of ; the screen output. That would permit long (path) filenames to be ; displayed/output (with screen wraparound handling the weird, ; extra-long ones). I believe that's why the PKZIP (Katz) author ; formatted his display that way. But the member names on the right ; is NOT convenient to me! Leaving it the original way (member file ; names on the left). ;v1.5 Updating for PKZIP v1.01 ; - Added "implode" to file compression style table ; (plus other tests to insure we catch illegal values). ; - Adding an "E" before the compression style ; (to indicate if file is encrypted) (verbose only). ; - Found bug in testing for ZIP member filename paths: ; PKZIP uses the "/" char for subdir separator instead of "\". ; Fixed. ; - Tightened up code for path-testing, ; extended the "+" path flag display for verbose as well as ; nonverbose displays. ; No, we aren't displaying paths yet. ; - If using wildcard member option (in verbose mode), ; we don't display verbose header until we find a qualifying ; file. ; - Total and total total displays: More than one qualifying member ; file must be found before the figures are displayed. (This is ; for verbose mode only.) ; - Totals (qualifying member files, each ZIP) ; - Total totals (qualifying member files, ALL qualifying ZIPs) ; - WildCard searches: ; Considered not displaying a target .ZIP file's name at ALL ; if it has no "eligible" member wildcard contents (to shorten ; output to just those .ZIP files (and members) found in a wildcard ; search. However, decided a non-find is valuable information. ; At least the .ZIP file name will be output. ; ; - Removed earlier v1.n flags from code ; ; Considering processing file names (vname) to handle "long" names ; (e.g., those with paths). ; Paths would probably only be displayed in verbose mode ; (on a separate line, or maybe to screen right, letting screen ; display handle "wraparound"). ;v1.4a Gisbert W.Selke (RECK@DBNUAMA1.BITNET for now): allow '/' as ; switch char, too (for them die-hard DOS people like myself). ; Output rrrrreal 4-byte CRCs. Add text for 'Imploded'. ;v1.4 Keith Petersen (W8SDZ@WSMR-SIMTEL20.ARMY.MIL) informs me ZDIR ; is failing on a lot of ZIP files from local BBS's. Seems the BBS's ; are adding huge comments, and ZDIR can't find the central directory. ; Increasing ENDOFS (the amount of ZIP file trailer we read in) ; to allow for this. ; Keith also suggested the verbose mode as default .. but I don't agree! ; If I wanted verbose, I would have used PKZIP -v in the first place! ; Also programs like Buerg's ZIPV do that just fine. ;v1.3c Bug: I'd written code to handle no cmdline parms at all, ; but failed to test it! Turns out system locks up! ; Thanks to FAAR RBBS for alerting me. Sloppy testing procedures. ;v1.3b Bug: Forgot the added "-v" verbose switch as the FIRST PSP ; cmdline argument would blow away using our PSP FCB's to get ; the parsed member filename. ; Using _Args (from KEGELUNX unix-like cmdline parsing) ; to handle the -v switch anywhere on cmdline. ; (Affects Parse_CmdLine only.) ;v1.3a 23 Mar 89 ; - Adding file comment display to verbose mode. ; - Because of the occasional padding (by XMODEM) of garbage to the ; end of a file, we're back to reading a full 256 bytes at the ; ZIP file end to find that end structure (149 bytes for the largest ; likely ENDDIR structure, plus the padding to the next 128 boundary). ; If you don't HAVE any of these files, change ENDOFS back to 149. ;v1.3 22 Mar 89 ; - Adding verbose display (a -v switch). ; Cribbing code from QBARCV3.ASM (my improvements on QBARV2.ASM, ; a utility for RBBS ARC/PAK displays). ; Usage: ZDIR -v foob (yep, -v must be first parm) ;v1.2 21 Mar 89 ; - Missed the obvious .. the very last structure in a ZIP file ; (call it ENDDIR) contains a pointer to the central directory. ; Since the only variable length fields in that last structure ; are fairly short (zip comments, etc.), it should be MUCH smaller. ; We won't need that huge 5Kb SWAG for the initial directory read. ; Cutting buffer down to 128 bytes, reading in ENDDIR to get that ; central directory pointer, and then going right to central directory. ; Since the max possible ZIP file comment (in ENDDIR) is 7FH bytes, ; the max possible ENDDIR would be 7FH + 22 (normal structure size) ; or 149 bytes (ENDOFS). ; - Moved initial cmdline parsing down to code end ; (just to clean up things) ; - Caught a bug .. failed on a single '*' wildcard cmdline parm. ;v1.1 18 Mar 89 ; - Added full pathing capabilities for target .ZIP files. ; - Added ambiguous member screening (e.g., search FOOB.ZIP ; for just *.ASM files). ; - Cleaned up the kludgey ADIR wildcard finds with all its ; multiple DTAs, etc. ; - Still no way to test for member filename paths. ;Original ADIR.EXE fixes: ; - Fixed bug that never closed any files! ; - Changed to .COM format, tightened, etc. ;ZIP functional changes: MANY! I consider this almost a total rewrite ;(except for the kludge with wildcard finds from the original ADIR.EXE). ;(So that's settled now, too.) v1.7 ; - Since the filename length is variable (and may include paths), ; the handling, formatting and display is significantly different ; than in ADIR. ; - Have to put back the ambiguous member parsing. ;David Kirschbaum ;Toad Hall